<script setup lang="ts">
interface BannerListType {
  picUrl: string;
}
let bannerList = ref<BannerListType[]>([
  { picUrl: "/images/solution/banner-catering1.png" },
]);
onMounted(() => {
  getBanner();
});
const getBanner = async () => {
  const res = await useApi().app.getBanner({
    bannerCategory: "SOLUTION_RESTAURANT",
  });
  if (res.data.length) {
    bannerList.value = res.data;
  }
};
</script>
<template>
  <div class="pages">
    <div class="swiper-content">
      <div class="swiper-item-bg"></div>
      <Swiper
        :height="480"
        :pagination="{
          clickable: true,
          clickableClass: 'web-pagination',
        }"
        :modules="[SwiperPagination]"
      >
        <SwiperSlide
          class="banner-item"
          v-for="(item, index) in bannerList"
          :key="index"
          :style="{ backgroundImage: `url(${item.picUrl})` }"
        >
          <div class="content">
            <div class="txt-shadow">
              <h1 class="title" data-aos="fade-up" data-aos-duration="1000">
                智慧餐饮更未来
              </h1>
              <p
                class="desc"
                data-aos="fade-up"
                data-aos-duration="1000"
                data-aos-delay="500"
              >
                科技连接你我 支付改变生活
              </p>
            </div>
          </div>
        </SwiperSlide>
      </Swiper>
    </div>
    <div class="ability">
      <div class="content">
        <h1
          class="ability-title"
          data-aos="fade-up"
          data-aos-once="true"
          data-aos-duration="600"
          data-aos-delay="200"
        >
          我们能做什么
        </h1>
        <div class="ability-list">
          <img
            class="drink-icon"
            src="/images/solution/catering-icon2.png"
            alt="我们能做什么"
          />

          <div class="ability-top">
            <div class="top-icon">为您量身定制</div>
            <div class="top-txt">
              <p>
                甬易支付专业为餐饮商家量身定制的一体化智慧餐饮管理方案，集点餐&收银、管理&决策、会员管理&营销供应链管理及连锁零售于一体的解决方案新模式。
              </p>
            </div>
          </div>
        </div>
      </div>
    </div>
    <div class="advantage">
      <div class="content">
        <h1
          class="advantage-title"
          data-aos="fade-up"
          data-aos-once="true"
          data-aos-duration="600"
          data-aos-delay="200"
        >
          产品优势
        </h1>
        <div class="advantage-list">
          <div class="advantage-item">
            <div class="mask"></div>
            <div class="mask2"></div>
            <h6>多端同步，高效管理</h6>
          </div>
          <div class="advantage-item">
            <div class="mask"></div>
            <div class="mask2"></div>
            <h6>多级权限，团队协作</h6>
          </div>
          <div class="advantage-item">
            <div class="mask"></div>
            <div class="mask2"></div>
            <h6>云端服务，无需安装</h6>
          </div>
          <div class="advantage-item">
            <div class="mask"></div>
            <div class="mask2"></div>
            <h6>智能点餐</h6>
          </div>
          <div class="advantage-item">
            <div class="mask"></div>
            <div class="mask2"></div>
            <h6>快速下单</h6>
          </div>
          <div class="advantage-item">
            <div class="mask"></div>
            <div class="mask2"></div>
            <h6>会员营销</h6>
          </div>
        </div>
      </div>
    </div>
    <div class="footer">
      <div class="content">
        <h1>
          专业为餐饮商家量身定制的一体化智慧餐饮管理方案，集点餐&收银、管理&决策、
          会员管理&营销供应链管理及连锁零售于一体的解决方案新模式。
        </h1>
        <NuxtLink to="/register">
          <div class="go-btn">
            <span>立即体验</span>
            <img src="/images/layouts/arrow-white.png" alt="立即体验" />
          </div>
        </NuxtLink>
      </div>
    </div>
  </div>
</template>

<style lang="scss" scoped>
.pages {
  .go-btn {
    width: 308px;
    height: 48px;
    background: #e22000;
    border-radius: 4px 4px 4px 4px;
    font-weight: 400;
    font-size: 15px;
    color: #ffffff;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin: 34px auto;
    transition: all 0.3s ease-in-out;
    img {
      width: 19px;
      height: 9px;
      margin-left: 8px;
      transition: transform 0.3s ease-in-out;
    }
    &:hover {
      box-shadow: 0 0 15px rgba(226, 32, 0, 0.5);
      img {
        transform: translateX(10px);
      }
    }
  }
  .swiper-content {
    position: relative;
  }
  .swiper-item-bg {
    width: 50%;
    position: absolute;
    left: 0;
    z-index: 1;
    height: 100%;
    background-color: #070705;
    background-size: 100px cover;
    background-position: left;
  }
  .swiper {
    max-width: 1920px;
  }
  .banner-item {
    box-sizing: border-box;
    min-height: 480px;
    background-position: left;
    background-repeat: no-repeat;
    background-size: 100% 100%;
    .content {
      padding-left: 50px;
      box-sizing: border-box;
      text-align: right;
      .txt-shadow {
        display: inline-block;
        margin-right: 30px;
        margin-top: 134px;
        text-align: center;
      }
      .title {
        font-weight: 700;
        font-size: 56px;
        color: #070a14;
        letter-spacing: 1px;
      }
      .desc {
        margin-top: 12px;
        font-weight: 400;
        font-size: 21px;
        color: #202949;
        margin-top: 20px;
      }
    }
  }
  .ability {
    padding-top: 180px;
    padding-bottom: 190px;
    background-color: #fcfcfc;
    box-sizing: border-box;
    .ability-title {
      font-weight: 700;
      font-size: 42px;
      text-align: center;
      color: #070a14;
    }
    .ability-list {
      margin-top: 90px;
      padding-left: 35px;
      &::after {
        content: "";
        display: block;
        clear: both;
      }
      .drink-icon {
        float: left;
        width: 401px;
        height: 487px;
        position: relative;
        z-index: 2;
      }
      .ability-top {
        float: left;

        .top-icon {
          width: 435px;
          height: 151px;
          background-size: cover;
          background-repeat: no-repeat;
          background-image: url("/images/solution/catering-icon1.png");
          font-weight: 500;
          font-size: 40px;
          color: #00294f;
          padding-top: 45px;
          padding-left: 140px;
          box-sizing: border-box;
        }
        .top-txt {
          width: 790px;
          height: 236px;
          background: rgba(237, 240, 246, 0.5);
          border-radius: 5px 5px 5px 5px;
          padding-top: 12px;
          box-sizing: border-box;
          margin-left: -150px;
          z-index: 1;
          position: relative;
          p {
            margin-left: 242px;
            display: inline-block;
            width: 496px;
            font-weight: 400;
            font-size: 22px;
            color: #8b8b8b;
            line-height: 43px;
            text-align: justify;
          }
        }
      }
    }
  }
  .advantage {
    padding-top: 120px;
    padding-bottom: 134px;
    box-sizing: border-box;
    overflow: hidden;
    .advantage-title {
      font-weight: 700;
      font-size: 42px;
      color: #070a14;
      text-align: center;
    }
    .advantage-list {
      margin-top: 108px;
      padding-left: 35px;
      float: left;
      &::after {
        content: "";
        display: block;
        clear: both;
      }
      .advantage-item {
        width: 338px;
        height: 470px;
        margin-bottom: 60px;
        float: left;
        background-size: cover;
        background-repeat: no-repeat;
        overflow: hidden;
        margin-right: 59px;
        transition: all 0.3s ease;
        position: relative;
        .mask {
          width: 100%;
          height: 100%;
          position: absolute;
          left: 0;
          top: 0;
          z-index: 1;
          background: linear-gradient(
            180deg,
            #000000 0%,
            rgba(0, 0, 0, 0) 100%
          );
          transition: all 0.3s ease;
        }
        .mask2 {
          width: 100%;
          height: 100%;
          position: absolute;
          left: 0;
          top: 0;
          transform: translateY(-530px);
          z-index: 1;
          background: linear-gradient(
            180deg,
            #991600 4%,
            rgba(118, 17, 0, 0) 99%
          );
          transition: all 0.3s ease;
        }
        &:hover {
          transform: scale(1.05);
          transition: all 0.3s ease;
          h6 {
            font-weight: 600;
            transition: all 0.3s ease;
            font-size: 30px;
            z-index: 2;
            position: relative;
          }
          .mask2 {
            transform: translateY(0px);
          }
        }
        h6 {
          transition: all 0.3s ease;
          font-weight: 400;
          font-size: 20px;
          color: #ffffff;
          text-align: center;
          margin-top: 52px;
          z-index: 2;
          position: relative;
        }
        &:nth-child(3n) {
          margin-right: 0;
        }
        &:nth-child(1) {
          background-image: url("/images/solution/catering-ys1.png");
        }
        &:nth-child(2) {
          background-image: url("/images/solution/catering-ys2.png");
        }
        &:nth-child(3) {
          background-image: url("/images/solution/catering-ys3.png");
        }
        &:nth-child(4) {
          background-image: url("/images/solution/catering-ys4.png");
        }
        &:nth-child(5) {
          background-image: url("/images/solution/catering-ys5.png");
        }
        &:nth-child(6) {
          background-image: url("/images/solution/catering-ys6.png");
        }
      }
    }
  }
  .footer {
    max-width: 1920px;
    margin: 0 auto;
    height: 480px;
    margin-bottom: 150px;
    text-align: center;
    background-size: cover;
    background-position: left;
    background-repeat: no-repeat;
    background-image: url("/images/solution/catering-footer.png");
    h1 {
      display: inline-block;
      margin-top: 150px;
      font-weight: 500;
      font-size: 18px;
      color: #202949;
      width: 858px;
      line-height: 26px;
    }
  }
}
</style>
